package com.work.flow.service;

import com.work.flow.common.NotSameFileException;
import com.work.flow.dao.MultipartFileParam;
import com.work.flow.model.File;
import com.work.flow.model.PageModel;
import com.work.flow.model.ShapeFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface FileService {
    String chunkUploadByMappedByteBuffer(MultipartFileParam param, String path) throws IOException, NotSameFileException;

    /**
     * 解压zip格式的shp压缩包
     *
     * @param path
     * @return
     */
    ShapeFile unZipShp(String id, String path);

    /**
     * 通过id查找文件
     *
     * @param id
     * @return
     */
    File getFileById(String id);


    /**
     * 获取总数
     * @return
     */
    Long getCount(String key);

    /**
     * 获取文件列表
     * @return
     */
    List<File> getList();

    /**
     * 分页查询
     * @param pageModel
     * @return
     */
    List<File> queryByPage(PageModel pageModel);

    /**
     * 删除文件
     * @param id
     */
    void deleteById(String id);

    /**
     * 下载文件
     * @param path
     * @param response
     */
    void downLoadFileByPath(String path, HttpServletResponse response) throws Exception;
}
